{% extends './layout.html' %}

{% block body %}
    {% if g.user.is_authenticated %}
    <div style="">
        <a class="btn btn-primary" role="button" href="{{ url_for('reader.add') }}">新增</a>
    </div>
    {% endif %}
    {% if reader %}
    <div style="width:300px;margin:auto;text-align:center">
        <div style="margin: 10px;"><h1>{{ reader.title }}</h1></div>
        <div style="margin: 10px;">
            <img style="border-radius: 150px;" src="{{ url_for('static', filename='images/icon.jpg') }}">
        </div>
        <div style="margin:10px;">
        {% if reader.media_type == 1 %}
        <audio src="{{ reader.media_url }}" controls="controls">你的程序不支持播放音频</audio>
        {% else %}
        <video src="{{ reader.media_url }}" controls="controls">你的程序不支持播放视频</video>
        {% endif %}
        </div>
    </div>
    {% endif %}
    {% if readers %}
        <div class="panel panel-default">
            <div class="panel-heading">目录</div>
            <ul class="list-group">
                {% for r in readers %}
{#                    <li class="list-group-item {% if r.id == reader.id %}list-group-item-info{% endif %}"><a href="{{ url_for('reader_show', id=r.id) }}">{{ r.title }}</a> </li>#}
                    <a class="list-group-item {% if r.id == reader.id %}list-group-item-info{% endif %}" href="{{ url_for('reader.show', id=r.id) }}">{{ r.title }}</a>
                {% endfor %}
            </ul>
        </div>
    {% endif %}
{% endblock %}
